<script lang="ts">
export default {
  name: "XOder",
};
</script>
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance() as any;
const data = ref("");
const getData = () => {
  data.value = (Object as any).data;
};
onMounted(() => {
  console.log("组件挂载");
  proxy.$bus.on("data", (msg: string) => {
    console.log("vvvv", msg);
    data.value = msg;
  });
});
</script>

<template>
  <h1>order</h1>
  <el-form inline>
    <el-form-item label="数据">
      <el-input v-model="data" style="width: 200px" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="getData">获取数据</el-button>
    </el-form-item>
  </el-form>
</template>

<style lang="less" scoped></style>
